#ifndef SPHENIX_EMFCAL_SD_H
#define SPHENIX_EMFCAL_SD_H

#include <TNamed.h>
#include <vector>
#include <map>

#include "sPHENIX_DetectorConstruction.h"
#include "sPHENIX_CalorimeterHit.h"

using namespace std;

class sPHENIX_EMCalSD : public TNamed{
 public:
  sPHENIX_EMCalSD(const char* name, sPHENIX_DetectorConstruction* detector);
  sPHENIX_EMCalSD();
  virtual ~sPHENIX_EMCalSD();
  
  // methods
  void     Initialize();
  Bool_t   ProcessHits();
  void     EndOfEvent();
  void     Register();
  virtual void Print(Option_t* option = "") const;
  void     PrintTotal() const;

  // set methods
  void SetVerboseLevel(Int_t level);

  // get methods
  map<int,sPHENIX_CalorimeterHit*>& GetEMCalTowerEdepCol() {return EMCalTowerEdepCol;} 

 private:
  // methods
  void ResetHits();

  //data members
  sPHENIX_DetectorConstruction*    Detector;        ///< Detector construction
  Int_t                            SensingVolId; ///< Sensing material volume Id
  Int_t                            VerboseLevel;    ///< Verbosity level 
  Int_t                            counter;
  map<int,sPHENIX_CalorimeterHit*>         EMCalTowerEdepCol;  // Hits Collection
  map<int,sPHENIX_CalorimeterHit*>         *EMCalTowerEdepColPtr;

  ClassDef(sPHENIX_EMCalSD, 1);     /// sPHENIX_EMCalSD

};

/// Set verbose level
/// \param level The new verbose level value
inline void sPHENIX_EMCalSD::SetVerboseLevel(Int_t level)
{ VerboseLevel = level; }

#endif // SPHENIX_EMFCAL_SD_H
